//
//  RZVoiceRecordControl.h
//  RZIM
//
//  Created by reyzhang on 2021/8/18.
//  语音录制组件 结束录制工具类+录制UI  外观模式

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


@protocol RZVoiceRecordControlDelegate;
@interface RZVoiceRecordControl : NSObject

@property (nonatomic, weak) id<RZVoiceRecordControlDelegate> delegate;

#pragma mark - 对应用户操作动作的事件
- (void)onBeginRecordEvent;

- (void)onEndRecordEvent;

- (void)dragExitRecordEvent;

- (void)dragEnterRecordEvent;

- (void)onCancelRecordEvent;

@end




@protocol RZVoiceRecordControlDelegate <NSObject>

- (BOOL)recordWillBegin;
/*!
 开始录制语音消息
 */
- (void)voiceRecordControlDidBegin:(RZVoiceRecordControl *)voiceRecordControl;

/*!
 取消录制语音消息
 */
- (void)voiceRecordControlDidCancel:(RZVoiceRecordControl *)voiceRecordControl;

/*!
 结束录制语音消息
 */
- (void)voiceRecordControl:(RZVoiceRecordControl *)voiceRecordControl
                    didEnd:(NSData *)recordData
            recordFile:(NSURL *)recordFile
                  duration:(long)duration
                     error:(NSError *)error;
@end



NS_ASSUME_NONNULL_END
